import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:smart_home/utils/color_utils.dart';
import 'package:smart_home/widgets/common_cell.dart';
import '../../utils/extension/double.dart';

class SettingPage extends StatelessWidget {
  const SettingPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          elevation: 0,
          leading: GestureDetector(
            onTap: () {
              Get.back();
            },
            child: Icon(
              Icons.keyboard_arrow_left,
              color: Colors.black,
            ),
          ),
          centerTitle: true,
          backgroundColor: Colors.white,
          title: Text(
            "设置",
            style: TextStyle(color: Colors.black, fontSize: 16.px),
          ),
        ),
        body: ConstrainedBox(
          // constraints: BoxConstraints.expand(),
          constraints: BoxConstraints.expand(),
          child: Stack(alignment: AlignmentDirectional.topStart, children: [
            Column(
              children: [
                Divider(
                  height: 5.px,
                  color: ColorsUtil.hexColor(0xcccccc),
                ),
                Cell2(
                  title: "账号安全",
                  children: [],
                ),
                Cell2(
                  title: "消息通知",
                  children: [
                    Text(
                      "去开启",
                      style: TextStyle(color: ColorsUtil.hexColor(0x8d8d8d)),
                    )
                  ],
                ),
                Cell2(
                  title: "关于",
                  children: [],
                ),
              ],
            ),
            Positioned(
                bottom: 20.px,
                left: 20.px,
                right: 20.px,
                child: MaterialButton(
                    height: 50.px,
                    shape: RoundedRectangleBorder(
                        borderRadius: BorderRadius.all(Radius.circular(30.px))),
                    color: Colors.black,
                    onPressed: () {},
                    child: Text(
                      "退出登录",
                      style: TextStyle(color: Colors.white, fontSize: 12.px),
                    ))),
          ]),
        ));
  }
}


